import request from '@/utils/request'

// 查询规章制度列表
export function listCompanyRules(query) {
  return request({
    url: '/applet/companyRules/list',
    method: 'get',
    params: query
  })
}

// 查询规章制度详细
export function getCompanyRules(id) {
  return request({
    url: '/applet/companyRules/' + id,
    method: 'get'
  })
}

// 新增规章制度
export function addCompanyRules(data) {
  return request({
    url: '/applet/companyRules',
    method: 'post',
    data: data
  })
}

// 修改规章制度
export function updateCompanyRules(data) {
  return request({
    url: '/applet/companyRules',
    method: 'put',
    data: data
  })
}


// 修改规章制度状态
export function changeCompanyRulesStatus(id, status) {
  return request({
    url: `/applet/companyRules/changeStatus/${id}/${status}`,
    method: 'get'
  })
}

// 删除规章制度
export function delCompanyRules(id) {
  return request({
    url: '/applet/companyRules/' + id,
    method: 'delete'
  })
}
